package com.wn.consumer.demo08;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;
import sun.rmi.runtime.Log;

/**
 * @author yellow Docter
 * @date 2022 -11-04
 * @desc
 */
@Component
@Slf4j
public class DeadConsumer {

    @RabbitListener(
            bindings = @QueueBinding(
                    value = @Queue(
                            name = "dead-queue"
                    ),
                    exchange = @Exchange(
                            name = "dead-exchange",
                            type = ExchangeTypes.DIRECT
                    ),
                    key = "dead.key"
            )
    )
    public void handlerMsg(String msg){
        log.info("死信队列消费消息:{}",msg);
    }

}
